﻿@{
    ViewBag.Title = "Roles";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<form id="form1">
    <div role="tabpanel" class="tab-pane fade in" style="padding-top: 20px; margin-right: 30px;">
        <div id="roleList"></div>
    </div>
</form>

@*<div style="position: fixed; bottom: 10px; right: 10px;">
        <a class="btn btn-danger" onclick="btn_authcancelall()">撤销全部</a>
    </div>*@

<script>
    var keyValue = $.request("keyValue");
    $(function () {
        $("#roleList").treeview({
            height: 400,
            slimscroll: false,
            showcheck: true,
            url: "/SystemManage/SysShortcutMenu/GetAuthRoleList",
            param: { keyValue: keyValue }
        });
    });

    function AcceptClick() {
        var postData = {};
        postData["roleList"] = String($("#roleList").getCheckedNodes());
        $.submitForm({
            url: "/SystemManage/SysShortcutMenu/UpdateAuthRoleList?keyValue=" + keyValue,
            param: postData,
            success: function () {
                $.modalClose();
            }
        })
    }

    //function btn_authcancelall() {
    //    $.modalConfirm("撤销全部授权", function (flag) {
    //        if (flag) {
    //            var postData = {};
    //            $.submitForm({
    //                url: "/SystemManage/SysShortcutMenu/AuthCancelAllRole?keyValue=" + keyValue,
    //                param: postData,
    //                success: function () {
    //                    $.modalClose();
    //                }
    //            });
    //        }
    //    });
    //}
</script>